package org.example.myportfolio.dao.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.example.myportfolio.dao.mapper.WorkFilesMapper;
import org.example.myportfolio.dao.repository.WorkFileRepository;
import org.example.myportfolio.pojo.po.WorkFiles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Slf4j
@Repository("WorkFileRepository")
public class WorkFileRepositoryImpl implements WorkFileRepository {

    @Autowired
    private WorkFilesMapper workFilesMapper;

    @Override
    public void deleteByWorkId(Long workId) {
        QueryWrapper<WorkFiles> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("work_id", workId);
        int delete = workFilesMapper.delete(queryWrapper);
    }
}
